import {useCallback, useState} from "react";

export default function useBoolean(val: boolean) {
    const [state, setState] = useState(val);

    const on = useCallback(() => {
        setState(true);
    }, [state]);

    const off = useCallback(() => {
        setState(false);
    }, [state]);

    const list: any = [state, on, off, setState];

    return list;
}
